home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2007 December / PCWKCD1207B.iso / Blogowanie poza sfera / Flock 1.0 beta / flock-1.0RC3.en-US.win32.exe / flock / components / flockMediaChannel.js < prev    next >
Text File  |  2007-10-18  |  2KB  |  78 lines

  1. //
  2. // BEGIN FLOCK GPL
  3. // 
  4. // Copyright Flock Inc. 2005-2007
  5. // http://flock.com
  6. // 
  7. // This file may be used under the terms of of the
  8. // GNU General Public License Version 2 or later (the "GPL"),
  9. // http://www.gnu.org/licenses/gpl.html
  10. // 
  11. // Software distributed under the License is distributed on an "AS IS" basis,
  12. // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. // for the specific language governing rights and limitations under the
  14. // License.
  15. // 
  16. // END FLOCK GPL
  17. //
  18.  
  19. const FLOCK_MEDIA_CHANNEL_CID = Components.ID('{b208bef0-5658-11db-b0de-0800200c9a66}');
  20. const FLOCK_MEDIA_CHANNEL_CONTRACTID = '@flock.com/media-channel;1';
  21. const FLOCK_MEDIA_CHANNEL_IID = Components.interfaces.flockIMediaChannel;
  22.  
  23. function flockMediaChannel() {
  24. }
  25.  
  26. flockMediaChannel.prototype= {
  27.     title: "",
  28.  
  29.     QueryInterface: function(iid) {
  30.         if (!iid.equals(Components.interfaces.nsISupports) &&
  31.             !iid.equals(FLOCK_MEDIA_CHANNEL_IID))
  32.             throw Components.results.NS_ERROR_NO_INTERFACE;
  33.         return this;
  34.     }
  35. };
  36.  
  37.  
  38. var flockMediaChannelModule = {
  39.     registerSelf: function(compMgr, fileSpec, location, type) {
  40.         compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  41.         compMgr.registerFactoryLocation(FLOCK_MEDIA_CHANNEL_CID, 
  42.                                         "flockMediaChannel JS component", 
  43.                                         FLOCK_MEDIA_CHANNEL_CONTRACTID, 
  44.                                         fileSpec, 
  45.                                         location,
  46.                                         type);
  47.     },
  48.  
  49.     getClassObject: function(compMgr, cid, iid) {
  50.         if (!cid.equals(FLOCK_MEDIA_CHANNEL_CID))
  51.             throw Components.results.NS_ERROR_NO_INTERFACE;
  52.  
  53.         if (!iid.equals(Components.interfaces.nsIFactory))
  54.             throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
  55.  
  56.         return flockMediaChannelFactory;
  57.     },
  58.  
  59.     canUnload: function(compMgr) { return true; }
  60. };
  61.  
  62. var flockMediaChannelFactory = {
  63.     createInstance: function(outer, iid) {
  64.         if (outer != null)
  65.             throw Components.results.NS_ERROR_NO_AGGREGATION;
  66.     
  67.         if (!iid.equals(FLOCK_MEDIA_CHANNEL_IID) &&
  68.             !iid.equals(Components.interfaces.nsISupports))
  69.             throw Components.results.NS_ERROR_INVALID_ARG;
  70.  
  71.         return new flockMediaChannel();
  72.     }
  73. }
  74.  
  75. /* module initialisation */
  76. function NSGetModule(comMgr, fileSpec) { return flockMediaChannelModule; }
  77.  
  78.